import request from "@/config/request";


export const getAlgorithm = (param) => {
  return request.get("/get_config", {
    params: { circuit_diagram_name: param },
  });
};

export const addAlgorithm = (data) => {
  return request({
    url: "/update_config",
    method: "POST",
    data: data,
    headers: {
      "Content-Type": "application/json", // 确保后端可以解析 JSON 数据
    },
  });
};

export const addAlgorithmPre = (data) => {
  return request({
    url: "/update_config_pre",
    method: "POST",
    data: data,
    headers: {
      "Content-Type": "application/json", // 确保后端可以解析 JSON 数据
    },
  });
};